package com.salas.entity;
import static javax.persistence.GenerationType.IDENTITY;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.validator.Length;

/**
 * @author qiaoguangwei
 *
 */
@Entity
@Table(name = "image", catalog = "jacks")
public class Image {
	
	private Integer imageId;
	private String  imageURL;
	private Product product;
	
	@Id
	@GeneratedValue(strategy = IDENTITY)
	public Integer getImageId() {
		return imageId;
	}
	public void setImageId(Integer imageId) {
		this.imageId = imageId;
	}

	
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "Product_ID")
	public Product getProduct() {
		return product;
	}
	public void setProduct(Product product) {
		this.product = product;
	}
	
	@Column(name = "imageURL", length = 20)	
	public String getImageURL() {
		return imageURL;
	}
	public void setImageURL(String imageURL) {
		this.imageURL = imageURL;
	}

}
